package cn.cloud9.config;

import cn.cloud9.intf.UserService;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;

/**
 * @author OnCloud9
 * @description
 * @project Springboot-CXF
 * @date 2022年04月23日 16:58
 */
@Configuration
public class JaxWsConfig {
    /**
     * 业务总线
     */
    @Autowired
    private Bus bus;

    @Autowired
    private UserService userService;

    @Bean
    public Endpoint createEndpoint() {
        final EndpointImpl endpoint = new EndpointImpl(bus, userService);
        endpoint.publish("/userService");
        return endpoint;
    }
}
